package lesson14;

public class CarDemo {

	public static void main(String[] args) 
	{
		Person ivan = new Person();
		ivan.name = "Ivan";
		ivan.age = 21;
		
		Person maria = new Person();
		maria.name = "Maria";
		maria.age = 26;
		
		Car bmw = new Car();
		bmw.model = "X5";
		bmw.maxSpeed = 200.5;
		bmw.currentSpeed = 120;
		bmw.currentGear = 5;
		bmw.color = "Black";
		bmw.owner = ivan;
		
		Car opel = new Car();
		opel.model = "Corsa";
		opel.maxSpeed = 180;
		opel.currentSpeed = 50.5;
		opel.currentGear = 4;
		opel.color = "White";
		opel.owner = maria;
		
		/*System.out.println(bmw.model);
		System.out.println(bmw.maxSpeed);
		System.out.println(bmw.currentSpeed);
		System.out.println(bmw.currentGear);
		System.out.println(bmw.color);
		System.out.println(bmw.owner.name + " " + bmw.owner.age);
		
		System.out.println(opel.model);
		System.out.println(opel.maxSpeed);
		System.out.println(opel.currentSpeed);
		System.out.println(opel.currentGear);
		System.out.println(opel.color);
		System.out.println(opel.owner.name + " " + opel.owner.age);
		
		bmw.currentGear = 4;
		bmw.currentSpeed = 60;
		bmw.owner = new Person();
		bmw.owner.name = "Pesho";
		bmw.owner.age = 30;
		
		opel.owner.age = 50;
		
		
		System.out.println(bmw.model);
		System.out.println(bmw.maxSpeed);
		System.out.println(bmw.currentSpeed);
		System.out.println(bmw.currentGear);
		System.out.println(bmw.color);
		System.out.println(bmw.owner.name + " " + bmw.owner.age);*/
		
		bmw.accelerate(30);
		System.out.println(bmw.currentSpeed);
		bmw.changeGear(2);
		System.out.println(bmw.currentGear);
		bmw.changeGearUp();
		System.out.println(bmw.currentGear);
		bmw.changeGearDown();
		System.out.println(bmw.currentGear);
		bmw.changeColor("Pink");
	    System.out.println(bmw.color);
	}

}
